﻿using System;
using System.Collections;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace TCKQKL.Service.DataContract
{
    /// <summary>
    /// This class is part of the WCF Data Contract for Business Services.
    /// </summary>
    [DataContract()]
    public sealed class StocksDataModel
    {
        private string _symbol;
        private string _companyName;
        private decimal _volume;
        private decimal _closed;
        private decimal _ref;
        private decimal _ceiling;
        private decimal _floor;
        private decimal _open;
        private decimal _low;
        private decimal _high;
        private decimal _change;
        private string _exCenter;

        public StocksDataModel()
        {
        }

        public StocksDataModel(string symbol, string companyName, decimal closed, decimal open, decimal low, decimal high, decimal change,  decimal volume, decimal ceiling, decimal floor, decimal Ref, string exCenter)
        {
            this._symbol = symbol;
            this._companyName = companyName;
            this._volume = volume;
            this._closed = closed / 1000;
            this._open = open/1000;
            this._low = low / 1000;
            this._high = high / 1000;
            this._change = change / 1000;
            this._ceiling = ceiling / 1000;
            this._floor = floor / 1000;
            this._ref = Ref / 1000;
            this._exCenter = exCenter;
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "symbol", Order = 1, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "symbol", Order = 1)]
        public string Symbol
        {
            get
            {
                return _symbol;
            }

            set
            {
                this._symbol = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "companyName", Order = 2, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "companyName", Order = 2)]
        public string CompanyName
        {
            get
            {
                return _companyName;
            }

            set
            {
                this._companyName = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "closed", Order = 3, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "closed", Order = 3)]
        public decimal Closed
        {
            get
            {
                return _closed;
            }

            set
            {
                this._closed = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "open", Order = 4, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "open", Order = 4)]
        public decimal Open
        {
            get
            {
                return _open;
            }

            set
            {
                this._open = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "low", Order = 5, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "low", Order = 5)]
        public decimal Low
        {
            get
            {
                return _low;
            }

            set
            {
                this._low = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "high", Order = 6, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "high", Order = 6)]
        public decimal High
        {
            get
            {
                return _high;
            }

            set
            {
                this._high = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "changed", Order = 7, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "changed", Order = 7)]
        public decimal Changed
        {
            get
            {
                return _change;
            }

            set
            {
                this._change = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "volume", Order = 8, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "volume", Order = 8)]
        public decimal Volume
        {
            get
            {
                return _volume;
            }

            set
            {
                this._volume = value;
            }
        }

        [System.Xml.Serialization.XmlElementAttribute(ElementName = "ceiling", Order = 9, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "ceiling", Order = 9)]
        public decimal Ceiling
        {
            get
            {
                return _ceiling;
            }

            set
            {
                this._ceiling = value;
            }
        }
        [System.Xml.Serialization.XmlElementAttribute(ElementName = "floor", Order = 10, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "floor", Order = 10)]
        public decimal Floor
        {
            get
            {
                return _floor;
            }

            set
            {
                this._floor = value;
            }
        }
        [System.Xml.Serialization.XmlElementAttribute(ElementName = "Ref", Order = 11, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "Ref", Order = 11)]
        public decimal Ref
        {
            get
            {
                return _ref;
            }

            set
            {
                this._ref = value;
            }
        }
        [System.Xml.Serialization.XmlElementAttribute(ElementName = "exCenter", Order = 12, IsNullable = false)]
        [DataMember(IsRequired = false, Name = "exCenter", Order = 12)]
        public string exCenter
        {
            get
            {
                return _exCenter;
            }

            set
            {
                this._exCenter = value;
            }
        }

    }
}
